/*
 * PACKAGE NAME: com.jodinfo.outmirror.implementation.officialusr.service
 * FILE    NAME: OfficialUsrDaoImpl.java
 * COPYRIGHT: Copyright(c) © 2016 heroj Company Ltd. All Rights Reserved
 */ 
package com.jodinfo.outmirror.service.impl;


import java.util.List;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jodinfo.outmirror.dao.OfficialUsrDao;
import com.jodinfo.outmirror.entity.OfficialUsrEntity;
import com.jodinfo.outmirror.service.OfficialUsrDmlService;

/**
 * OfficialUsrDmlService实现
 * @author zhuxiaoliu
 * @date 2016年12月30日 上午9:08:32
 * @version <b>1.0.0</b>
 */
@Service(value="officialUsrDmlService")
public class OfficialUsrDmlServiceImpl implements OfficialUsrDmlService {

 private static final Logger logger = LoggerFactory.getLogger(OfficialUsrDmlServiceImpl.class);

 
	@Resource(name="officialUsrDao")
	private OfficialUsrDao officialUsrDao;
	

	/** 
	 * 
	 * @author zhuxiaoliu
	 * @date 2016年12月30日 上午9:15:36
	 * @see com.jodinfo.outmirror.implementation.officialusr.OfficialUsrDmlService#addOfficialUsr(OfficialUsrEntity officialUsrEntity)
	 * @param OfficialUsrEntity officialUsrEntity
	 * @return int
	 */
	@Transactional(rollbackFor = Exception.class) 
	@CacheEvict(allEntries=true,beforeInvocation=true)
	public int addOfficialUsr(OfficialUsrEntity officialUsrEntity) {
		int i = 0;
		try{
		//	i = officialUsrDao.add(officialUsrEntity);
		}catch(Exception e){
			logger.error(e.getMessage());
			//throw new OfficialUsrException("OfficialUsrEntity插入数据异常,",e.getMessage());
		}
		return i;
	}
	/** 
	 * 
	 * @author zhuxiaoliu
	 * @date 2016年12月30日 上午9:15:36
	 * @see com.jodinfo.outmirror.implementation.officialusr.OfficialUsrDmlService#updateOfficialUsr(OfficialUsrEntity officialUsrEntity)
	 * @param OfficialUsrEntity officialUsrEntity
	 * @return int
	 */
	@Transactional(rollbackFor = Exception.class)
	@CacheEvict(allEntries=true,beforeInvocation=true)
	public int updateOfficialUsr(OfficialUsrEntity officialUsrEntity) {
	
		int i = 0;
		try{
			//i =  officialUsrDao.update(officialUsrEntity);;
		}catch(Exception e){
			logger.error(e.getMessage());
			//throw new OfficialUsrException("OfficialUsrEntity更新数据异常,",e.getMessage());
		}
		return i;
	}
	
	/**
	 * 批量插入List<OfficialUsrEntity> officialUsrEntityList
	 * @author shensu
	 * @date 2016年12月30日 上午9:11:48
	 * @param List<OfficialUsrEntity> officialUsrEntityList
	 * @return int
	 */
	@Transactional(rollbackFor = Exception.class) 
	@CacheEvict(allEntries=true,beforeInvocation=true)
	public int batchAddOfficialUsr(List<OfficialUsrEntity> officialUsrEntityList) {
		int i = 0;
		try{
		//	i =  officialUsrDao.add(officialUsrEntityList);
		}catch(Exception e){
			logger.error(e.getMessage());
			//throw new OfficialUsrException("OfficialUsrEntity更新数据异常,",e.getMessage());
		}
		return i;
	}
	
	/**
	 * 批量更新List<OfficialUsrEntity> officialUsrEntityList
	 * @author shensu
	 * @date 2016年12月30日 上午9:11:48
	 * @param List<OfficialUsrEntity> officialUsrEntityList
	 * @return int
	 */
	@Transactional(rollbackFor = Exception.class) 
	@CacheEvict(allEntries=true,beforeInvocation=true)
	public int batchUpdateOfficialUsr(List<OfficialUsrEntity> officialUsrEntityList) {
		int i = 0;
		try{
		//	i =  officialUsrDao.updates(officialUsrEntityList);
		}catch(Exception e){
			logger.error(e.getMessage());
			//throw new OfficialUsrException("OfficialUsrEntity更新数据异常,",e.getMessage());
		}
		return i;
	}
	
}

